<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../../学习资料/lib/jquery/jquery-3.2.1.js"></script>
</head>
<body>
    <script>
        let promise = new Promise((resolve,reject)=>{
            $.ajax({
                method:'get',
                url:"http://localhost:3000/",
                success:(data)=>{
                    console.log(data);
                    resolve(data);
                },
                error:(err)=>{
                    console.log(err);
                    reject(err);
                }
            })
        })

        promise.then((data)=>{
            console.log(data);
        })

        promise.catch((err)=>{
            console.log(err);
        })
    </script>
</body>
</html>